package Exercicios;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

class Line {
	public class Point {
		public int x, y;
	}

	public Point getPoint() {
		return new Point();
	}
	// public static class Point { }
}

class Triangle {
	Line.Point p = new Line().new Point();
	public Triangle() {
		Line.Point p = (new Line()).getPoint();
	}
}

class One {
	public One() {
		System.out.print(1);
	}
}

class Two extends One {
	public Two() {
		System.out.print(2);
	}
}

class Three extends Two {
	public Three() {
		System.out.print(3);
	}
}

public class Fabric {

	public enum Title {

		MR("Mr."), MRS("Mrs."), MS("Ms.");

		private final String title;

		private Title(String t) {
			title = t;
		}

		public String format(String last, String first) {
			return title + "" + first + "" + last;
		}
	}

	public enum Color {
		RED(0xff0000), GREEN(0x00ff00), BLUE(0x0000ff);
		private final int rgb;

		Color(int rgb) {
			this.rgb = rgb;
		}

		public int getRGB() {
			return rgb;
		}
	};

	private int counter = 0;

	static void alpha() { /* more code here */
	}

	void beta() { /* more code here */
		Fabric.alpha();
	}

	// static final int[] a = { 100,200 };

	// static final int[] a;
	// static { a=new int[2]; a[0]=100; a[1]=200; }

	public void doit() {
	}

	public enum Dogs {
		collie, harrier, shepherd
	};

	public static void main(String[] argv) {

		Color treeColor = Color.GREEN;
		if (Color.RED.ordinal() < Color.BLUE.ordinal()) {
		}



		// new Three();
		Dogs myDog = Dogs.shepherd;
		switch (myDog) {
		case collie:
			System.out.print("collie");
		default:
			System.out.print("retriever ");
		case harrier:
			System.out.print("harrier ");
		}

		Integer i = new Integer(1) + new Integer(2);
		switch (i) {
		case 3:
			System.out.println("three");
			break;
		default:
			System.out.println("other");
			break;
		}

		Boolean.valueOf("True");

		System.out.println(Title.MR.format("Doe", "John"));

		Object obj = new int[] { 1, 2, 3 };
		int[] someArray = (int[]) obj;
		 for (int o: someArray)
		 System.out.print(o);

		String str = "null";
		if (str == null) {
			System.out.println("null");
		} else if (str.length() == 0) {
			System.out.println("zero");
		} else {
			System.out.println("some");
		}

		/*
		 * int x=0; int y=10; do { y--; ++x; } while (x < 5); System.out.print(x
		 * + "," + y);
		 */

		int x = 10;
		do {
			--x;
		} while (x < 10);

		List list = new ArrayList();
		list.add("1 ");
		list.add("2");
		list.add("3");


		/* for (Object obj1: reverse(list))
			 System.out.print(obj1 + ",");
*/

		for (Object ob : get()) {
			System.out.print(ob + ", ");
		}

		for (int t = 0; t <= 10; t++) {
			if (t > 6)
				break;

		}
		// System.out.println(t);
	}

	public static Collection get() {
		Collection sorted = new LinkedList();
		sorted.add("B");
		sorted.add("C");
		sorted.add("A");
		return sorted;
	}

	public static Iterator reverse(List list) {
		Collections.reverse(list);
		return list.iterator();
	}
}
